<!DOCTYPE html>

<html class="app-ui">

	<head>
		<!-- Meta -->
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />

		<!-- Document title -->
		<title>万邦-云阅卷</title>

		<meta name="description" content="AppUI - Admin Dashboard Template & UI Framework" />
		<meta name="author" content="rustheme" />
		<meta name="robots" content="noindex, nofollow" />

		<!-- Favicons -->
		<link rel="apple-touch-icon" href="assets/img/favicons/apple-touch-icon.png" />
		<link rel="icon" href="assets/img/favicons/favicon.ico" />

		<!-- Google fonts -->
		<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,400italic,500,900%7CRoboto+Slab:300,400%7CRoboto+Mono:400" />

		<!-- Page JS Plugins CSS -->
		<link rel="stylesheet" href="assets/js/plugins/slick/slick.min.css" />
		<link rel="stylesheet" href="assets/js/plugins/slick/slick-theme.min.css" />

		<!-- AppUI CSS stylesheets -->
		<link rel="stylesheet" id="css-font-awesome" href="assets/css/font-awesome.css" />
		<link rel="stylesheet" id="css-ionicons" href="assets/css/ionicons.css" />
		<link rel="stylesheet" id="css-bootstrap" href="assets/css/bootstrap.css" />
		<link rel="stylesheet" id="css-app" href="assets/css/app.css" />
		<link rel="stylesheet" id="css-app-custom" href="assets/css/app-custom.css" />
		<!-- End Stylesheets -->
	</head>

	<body class="app-ui layout-has-drawer layout-has-fixed-header">
		<div class="app-layout-canvas">
			<div class="app-layout-container">

				<!-- Drawer -->
				<aside class="app-layout-drawer">

					<!-- Drawer scroll area -->
					<div class="app-layout-drawer-scroll">
						<!-- Drawer logo -->
						<div id="logo" class="drawer-header">
							<a href="index.html">
								<h4 style=" text-align:center">云阅卷</h4>
							</a>
						</div>

						<!-- Drawer navigation -->
						<nav class="drawer-main">
							<ul class="nav nav-drawer">


								<li class="nav-item nav-drawer-header">菜单导航</li>

								<li class="nav-item nav-item-has-subnav">
									<a href="javascript:void(0)"><i class="ion-ios-calculator-outline"></i>考试管理</a>
									<ul class="nav nav-subnav">

										<li>
											<a href="examList.html">考试列表</a>
										</li>

										<li>
											<a href="createExam.html">创建考试</a>
										</li>
									</ul>
								</li>

								<li class="nav-item nav-item-has-subnav">
									<a href="javascript:void(0)"><i class="ion-ios-compose-outline"></i> 在线阅卷</a>
									<ul class="nav nav-subnav">

										<li>
											<a href="examSetting.html">阅卷设置</a>
										</li>

										<li>
											<a href="examPapers.html">我要阅卷</a>
										</li>

										<li>
											<a href="examProblemPapers.html">问题卷处理</a>
										</li>
										<li>
											<a href="examProgress.html">进度监控</a>
										</li>

										<li>
											<a href="examQuality.html">质量抽查</a>
										</li>

									</ul>
								</li>


								<li class="nav-item nav-item-has-subnav">
									<a href="javascript:void(0)"><i class="ion-ios-list-outline"></i> 成绩管理</a>
									<ul class="nav nav-subnav">

										<li>
											<a href="examReport.html">考试成绩单</a>
										</li>

										<li>
											<a href="examSubReport.html">单科试题得分表</a>
										</li>

										<li>
											<a href="gradeAnalyze.html">年纪成绩分析</a>
										</li>

										<li>
											<a href="classAnalyze.html">班级成绩分析</a>
										</li>

									</ul>
								</li>

								<li class="nav-item nav-item-has-subnav">
									<a href="javascript:void(0)"><i class="ion-ios-browsers-outline"></i> 教师讲卷</a>
									<ul class="nav nav-subnav">

										<li>
											<a href="scoreAndPapers.html">成绩与答卷</a>
										</li>

										<li>
											<a href="highScoreComposition.html">高分作文</a>
										</li>

										<li>
											<a href="topicScore.html">试题得分情况</a>
										</li>

										<li>
											<a href="subAnalyzeReport.html">学科分析报表</a>
										</li>
									</ul>
								</li>

								<li class="nav-item nav-item-has-subnav">
									<a href="javascript:void(0)"><i class="ion-social-javascript-outline"></i> 用户中心</a>
									<ul class="nav nav-subnav">

										<li>
											<a href="schoolManager.html">学校管理</a>
										</li>

										<li>
											<a href="subManager.html">学科管理</a>
										</li>

										<li>
											<a href="gradeManager.html">年级管理</a>
										</li>

										<li>
											<a href="gradeAndSubManager.html">年级与学科关系维护</a>
										</li>

										<li>
											<a href="teaManager.html">教师管理</a>
										</li>

										<li>
											<a href="classManager.html">班级管理</a>
										</li>

										<li>
											<a href="stuManager.html">学生管理</a>
										</li>

										<li>
											<a href="subAdnClassAnager.html">学科与班级关系维护</a>
										</li>
									</ul>
								</li>

							</ul>
						</nav>
						<!-- End drawer navigation -->

						<div class="drawer-footer">
							<p class="copyright">Copyright &copy; 2020.北京万邦易嵌科技有限公司.<a target="_blank" href="http://www.wanbangee.com">万邦易嵌</a></p>
						</div>
					</div>
					<!-- End drawer scroll area -->
				</aside>
				<!-- End drawer -->

				<!-- Header -->
				<header class="app-layout-header">
					<nav class="navbar navbar-default">
						<div class="container-fluid">
							<div class="navbar-header">
								<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#header-navbar-collapse"
								 aria-expanded="false">
									<span class="sr-only">Toggle navigation</span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
								</button>
								<button class="pull-left hidden-lg hidden-md navbar-toggle" type="button" data-toggle="layout" data-action="sidebar_toggle">
									<span class="sr-only">Toggle drawer</span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
								</button>
								<span class="navbar-page-title">

									Dashboard
								</span>
							</div>

							<div class="collapse navbar-collapse" id="header-navbar-collapse">
								<!-- Header search form -->
								<form class="navbar-form navbar-left app-search-form" role="search">
									<div class="form-group">
										<div class="input-group">
											<input class="form-control" type="search" id="search-input" placeholder="Search..." />
											<span class="input-group-btn">
												<button class="btn" type="button"><i class="ion-ios-search-strong"></i></button>
											</span>
										</div>
									</div>
								</form>

								<ul id="main-menu" class="nav navbar-nav navbar-left">
									<li class="dropdown">
										<a href="#" data-toggle="dropdown">English <span class="caret"></span></a>

										<ul class="dropdown-menu">
											<li><a href="javascript:void(0)">French</a></li>
											<li><a href="javascript:void(0)">German</a></li>
											<li><a href="javascript:void(0)">Italian</a></li>
										</ul>
									</li>
									<li class="dropdown">
										<a href="#" data-toggle="dropdown">Pages <span class="caret"></span></a>

										<ul class="dropdown-menu">
											<li><a href="javascript:void(0)">Analytics</a></li>
											<li><a href="javascript:void(0)">Visits</a></li>
											<li><a href="javascript:void(0)">Changelog</a></li>
										</ul>
									</li>
								</ul>
								<!-- .navbar-left -->

								<ul class="nav navbar-nav navbar-right navbar-toolbar hidden-sm hidden-xs">
									<li>
										<!-- Opens the modal found at the bottom of the page -->
										<a href="javascript:void(0)" data-toggle="modal" data-target="#apps-modal"><i class="ion-grid"></i></a>
									</li>

									<li class="dropdown">
										<a href="javascript:void(0)" data-toggle="dropdown"><i class="ion-ios-bell"></i> <span class="badge">3</span></a>
										<ul class="dropdown-menu dropdown-menu-right">
											<li class="dropdown-header">Profile</li>
											<li>
												<a tabindex="-1" href="javascript:void(0)"><span class="badge pull-right">3</span> News </a>
											</li>
											<li>
												<a tabindex="-1" href="javascript:void(0)"><span class="badge pull-right">1</span> Messages </a>
											</li>
											<li class="divider"></li>
											<li class="dropdown-header">More</li>
											<li>
												<a tabindex="-1" href="javascript:void(0)">Edit Profile..</a>
											</li>
										</ul>
									</li>

									<li class="dropdown dropdown-profile">
										<a href="javascript:void(0)" data-toggle="dropdown">
											<span class="m-r-sm">John Doe <span class="caret"></span></span>
											<img class="img-avatar img-avatar-48" src="assets/img/avatars/avatar3.jpg" alt="User profile pic" />
										</a>
										<ul class="dropdown-menu dropdown-menu-right">
											<li class="dropdown-header">
												Pages
											</li>
											<li>
												<a href="base_pages_profile.html">Profile</a>
											</li>
											<li>
												<a href="base_pages_profile.html"><span class="badge badge-success pull-right">3</span> Blog</a>
											</li>
											<li>
												<a href="frontend_login_signup.html">Logout</a>
											</li>
										</ul>
									</li>
								</ul>
								<!-- .navbar-right -->
							</div>
						</div>
						<!-- .container-fluid -->
					</nav>
					<!-- .navbar-default -->
				</header>
				<!-- End header -->

				<main class="app-layout-content">
					
					<div class="container-fluid p-y-md">
					    <div class="row">
					        
					        <!-- .col-sm-5 -->
					
					        <div class="col-sm-12 col-lg-12">
					            <!-- Message List -->
					            <div class="card">
					                <div class="card-header">
					                    <button class="btn btn-back">返回</button>
										<label >考试：<span class="label-examNm"></span></label>
										<label >科目：<span class="label-examSubNm"></span></label>
					                    
					                </div>
					                <div class="card-block " id="">
					                    <div class="card-head1">
											<label >题组：<span class="exam-topicno"></span> </label>
											<label >分值：<span class="exam-topicscore"></span></label>
											<label >抽查进度：<span class="exam-progress"></span></label>
										</div>
										 <div class="card-head2">
											<label>抽查方式：</label>
											<button class="spot-check" data-order="1">随机</button>
											<button class="spot-check"  data-order="2">分数由高到低</button>
											<button class="spot-check"  data-order="3">分数由低到高</button>
											<button class="btn btn-prev"  >上一题</button>
											<button class="btn btn-next"  >下一题</button>
										</div>
										<div class="card-body row">
											<div id="card-body-img" style="float: left;margin-left: 1%;">
												<img style="width: 500px;height: 200px;" class="topic-img" src=""/>
											</div>
											<div id="card-body-text " style="float: right;margin-right: 5%;">
												<div >
													<label >阅卷人：<span class="tea-nm"></span>     </label>
													<label >阅卷评分：<span class="tea-score"></span>  </label>
													
													<div class="">
														<textarea class="form-control repeat-cause" style="width: 400px; height: 100px;" id="example-textarea-input" name="example-textarea-input" rows="6" placeholder="请填写重评原因..."></textarea>
														
													</div>
													<button class="btn" id="btn-repeat">打回重评</button>
													
												</div>
											</div>
											
											
										</div>
					                   
					                    	<!-- DataTables init on table by adding .js-dataTable-full class, functionality initialized in js/pages/base_tables_datatables.js -->
					                    	
					                    	
					                    	
											
											
											
					                    
					                   
										

					                </div>
					                <!-- .card-block -->
					            </div>
					            <!-- .card -->
					            <!-- End Message List -->
					        </div>
					        <!-- .col-sm-7 -->
					    </div>
					    <!-- .row -->
					</div>
					
					
					
					
					
					
					


				</main>

			</div>
			<!-- .app-layout-container -->
		</div>
		<!-- .app-layout-canvas -->

		<!-- Apps Modal -->
		<!-- Opens from the button in the header -->

		<!-- End Apps Modal -->



		<!-- AppUI Core JS: jQuery, Bootstrap, slimScroll, scrollLock and App.js -->
		<script src="assets/js/core/jquery.min.js"></script>
		<script src="assets/js/core/bootstrap.min.js"></script>
		<script src="assets/js/core/jquery.slimscroll.min.js"></script>
		<script src="assets/js/core/jquery.scrollLock.min.js"></script>
		<script src="assets/js/core/jquery.placeholder.min.js"></script>
		<script src="assets/js/app.js"></script>
		<script src="assets/js/app-custom.js"></script>

		<!-- Page Plugins -->

		<script src="assets/js/plugins/slick/slick.min.js"></script>
		<script src="assets/js/score/Chart.min.js"></script>
		<script src="assets/js/score/echarts.min.js"></script>
		<script src="assets/js/plugins/flot/jquery.flot.min.js"></script>
		<script src="assets/js/plugins/flot/jquery.flot.pie.min.js"></script>
		<script src="assets/js/plugins/flot/jquery.flot.stack.min.js"></script>
		<script src="assets/js/plugins/flot/jquery.flot.resize.min.js"></script>

		<!-- Page JS Code -->
		<!-- <script src="assets/js/pages/index.js"></script> -->
		<script>
			
			//用于获取 url 参数
			function getUrlParam(name) {
				//构造一个含有目标参数的正则表达式对象
				var reg = new RegExp("(^|&)" +name + "=([^&]*)(&|$)");
				//匹配目标参数
				var r = window.location.search.substr(1).match(reg);
				if (r != null) {
					return unescape(r[2]);
				} else {
					//返回参数值
					return "";
				}
			}
			
			// var examId = sessionStorage.getItem("qualityInfoExamId");
			// var examSubId = sessionStorage.getItem("qualityInfoExamSubId");
			// var markerId = sessionStorage.getItem("qualityInfoMakerId");
			// var topicNo = sessionStorage.getItem("qualityInfoTopicNo");
			var examId = getUrlParam("examId");
			var examSubId = getUrlParam("examSubId");
			var markerId = getUrlParam("markerId");
			var topicNo = getUrlParam("topicNo");
			
			
			
			
			
			var order = 1;
			var allInfo = null;
			var index = 0;
			var scoreId = -1;
			var flag = false;
			var isRepeatCount = 0;
			
			///updateCheckScore/{examId}/{examSubId}/{scoreId}/{repeatCause}
			//返回按钮
			function backClick(){
				$(".btn-back").click(function(){
					history.go(-1);
				});
			}
			
			//打回重评按钮
			function repeatClick(){
				$("#btn-repeat").click(function(){
					if(scoreId!=-1){
						var repeatCause = $(".repeat-cause").val();
						if(repeatCause.length==0){
							alert("请输入原因")
						}else{
							var url = "http://localhost:6630/wanbangee/exam-score/quality/updateCheckScore";
							var data = {
								examId: examId,
								examSubId: examSubId,
								scoreId: scoreId,
								repeatCause: repeatCause
							}
							var token = sessionStorage.getItem("token")
							$.ajax({
								headers: {
									"token": token
								},
								type: "put", //请求方式
								async: true, //是否异步
								url: url,
								crossDomain: true,
								data: data,
								contentType: "application/x-www-form-urlencoded",
								//jsonpCallback:"successCallback",    //自定义跨域参数值，回调函数名也是一样，默认为jQuery自动生成的字符串
								success: function(data) {
									//请求成功处理，和本地回调完全一样
								
									console.log(data)
									if (data.code == 1001) {
										if(data.result==null){
											
										}else{
											
										}
										isRepeatCount ++;
										allInfo.scoreDetails.splice(index,1);
										if(allInfo.scoreDetails.length==0){
											alert("审核完毕")
										}else{
											$(".exam-progress").text(index+"/"+allInfo.scoreDetails.length);
											setInfo(allInfo)
											
										}
									}
								},
							});
							console.log(url)
						}
						
						
					}
					
					
				});
			}
			
			//信息设置
			function setInfo(data){
				if(data!=null){
					console.log(data)
					$(".label-examNm").text(data.examNm);
					$(".label-examSubNm").text(data.subNm);
					$(".exam-topicno").text(data.topicNo);
					
					
					$(".topic-img").attr("src",data.scoreDetails[index].sScore.topicUrl);
					if(allInfo.scoreType==1){
						$(".tea-nm").text(allInfo.teaNm1)
					}else{
						$(".tea-nm").text(allInfo.teaNm1+","+allInfo.teaNm2)
					}
					
					if(index==0){
						scoreId = allInfo.scoreDetails[index].scoreId;
						
						$(".exam-topicscore").text(allInfo.topicScore);
						
						$(".exam-progress").text(index+"/"+allInfo.scoreDetails.length);
						
						
						$(".tea-score").text(allInfo.scoreDetails[index].score1);
					}
					
				}
			}
			//抽查方式
			function orderSelectClick(){
				$(".spot-check").click(function(){
					order = $(this).attr("data-order");
					index = 0;
					getExamTeaInfo(markerId,order,examId,examSubId,topicNo);
				});
			}
			//下一题点击事件
			function nextClick(){
				$(".btn-next").click(function(){
					if(index >= allInfo.scoreDetails.length ){
						return ;
					}else{
						index++;
						$(".exam-topicNo").text(allInfo.topicNo);
						
						$(".exam-progress").text(index+"/"+allInfo.scoreDetails.length);
						if(allInfo.scoreType==1){
							$(".tea-nm").text(allInfo.teaNm1)
						}else{
							$(".tea-nm").text(allInfo.teaNm1+","+allInfo.teaNm2)
						}
						console.log(index)
						
						if(index < allInfo.scoreDetails.length ){
							$(".tea-score").text(allInfo.scoreDetails[index].score1);
							scoreId = allInfo.scoreDetails[index].scoreId;
						}
						
					}
					
					
				});
			}
			
			//上一题点击事件
			function prevClick(){
				$(".btn-prev").click(function(){
					console.log(index)
					if(index<=0){
						scoreId = allInfo.scoreDetails[index].scoreId;
						return ;
					}else{
						index--;
						$(".exam-topicNo").text(allInfo.topicNo);
						
						$(".exam-progress").text(index+"/"+allInfo.scoreDetails.length);
						if(allInfo.scoreType==1){
							$(".tea-nm").text(allInfo.teaNm1)
						}else{
							$(".tea-nm").text(allInfo.teaNm1+","+allInfo.teaNm2)
						}
						scoreId = allInfo.scoreDetails[index].scoreId;
						if(index < allInfo.scoreDetails.length )
						$(".tea-score").text(allInfo.scoreDetails[index].score1);
					}
				});
			}
			
			//获得该阅卷组的信息
			function getExamTeaInfo(markerId,order,examId,examSubId,topicNo){
				var url = "http://localhost:6630/wanbangee/exam-score/quality/selectExamTeaInfo/"+markerId+"/"+order+"/"+examId+"/"+examSubId+"/"+topicNo
				var token = sessionStorage.getItem("token")
				$.ajax({
					headers: {
						"token": token
					},
					type: "get", //请求方式
					async: true, //是否异步
					url: url,
					crossDomain: true,
					contentType: "application/x-www-form-urlencoded",
					//jsonpCallback:"successCallback",    //自定义跨域参数值，回调函数名也是一样，默认为jQuery自动生成的字符串
					success: function(data) {
						//请求成功处理，和本地回调完全一样
					
						console.log(data)
						if (data.code == 1001) {
							if(data.result==null){
								
							}else{
								allInfo = data.result;
								setInfo(data.result);
							}
						}
					},
				});
			}
			
			$(function() {
				getExamTeaInfo(markerId,order,examId,examSubId,topicNo);
				//抽查方式
				orderSelectClick();
				//下一题点击事件
				prevClick();
				//上一题点击事件
				nextClick();
				//打回重评按钮
				repeatClick();
				//返回按钮
				backClick();
				
				
			});
		</script>

	</body>

</html>
